<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    function loadScript(src) {
      return new Promise((resolve, reject) => {
        const script = document.createElement('script');
        script.src = src
        script.onload = () => resolve(script)
        script.onerror = reject
        document.body.appendChild(script)
      })
    }
    loadScript('./js/01-test.js').then(script => {
      console.log(script)
      // test01()
      return loadScript('./js/02-test.js')
    }).then(()=>{
      test02()
    })
  </script>
</body>
</html>